package com.naiterui.ehp.bs.cms.modules.recommend.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.naiterui.ehp.bp.bo.esign.PreSignResultBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;


@RequestMapping("/inner/recom/cms")
@FeignClient(name = "recom", url = "${ehp.domain.tuijian}", configuration = FeignConfiguration.class)
public interface IRecomFeignClient {

    /**
     * 电子签名预签署(发送验证码)
     *
     * @param recomId
     * @param pharmacistId
     *
     * @throws BusinessException
     */
    @PostMapping("/preSign")
    PreSignResultBO preSign(@RequestParam("recomId") Long recomId, @RequestParam("pharmacistId") Long pharmacistId)
        throws BusinessException;

    /**
     * 电子签名签署
     *
     * @param recomId
     * @param pharmacistId
     * @param signPwd      验证码
     *
     * @throws BusinessException
     */
    @PostMapping("/sign")
    void sign(@RequestParam("recomId") Long recomId, @RequestParam("pharmacistId") Long pharmacistId,
              @RequestParam("signPwd") String signPwd,@RequestParam("uniqueId") String uniqueId) throws BusinessException;

    /**
     * 处方审核
     */
    @PostMapping("/audit")
    void audit(@RequestParam("recomId") Long recomId, @RequestParam("status") Integer status, @RequestParam("remark") String remark,
               @RequestParam("pharmacistId") Long pharmacistId, @RequestParam("force") Integer force,
               @RequestParam("signPwd") String signPwd) throws BusinessException;

    /**
     * 设置审核开关
     */
    @PostMapping("/audit/config")
    void setAuditConfig(@RequestParam("auditType") Integer auditType, @RequestParam("remark") String remark,
                        @RequestParam("operator") String operator) throws BusinessException;
}
